package net.huashitong.scheduling.dao;

import com.sirdc.modules.core.dao.GenericQuery;
import com.sirdc.modules.core.dao.StringDao;
import net.huashitong.scheduling.entity.BranchCompany;
import net.huashitong.scheduling.filter.BranchCompanyFilter;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class BranchCompanyDao  extends StringDao<BranchCompany> {

    public List<BranchCompany> queryBranchCompanyList(BranchCompanyFilter filter){
        GenericQuery query = createQuery("obj");
        query.append(" and obj.branchName= :branchName ").setParam("branchName", filter.getName());
        query.append(" and obj.currentMonth= :currentMonth ").setParam("currentMonth", filter.getCurrentMonth());
        return query.listResult();
    }
}
